using System;
namespace Systemathics.FrameWork
{
    [Serializable]
    public sealed class VirtualMarketParameters
    {
        private static double hitorTakeProbability;
        private static double minimumHitRatioProbability;
        private static double rejectionProbability;

        public VirtualMarketParameters()
        {
            AckDelay = 35;
            RejectionProbability = 0.01;
            MinimumHitRatioProbability = 0.7;
            hitorTakeProbability = 0.8;
        }

        public int AckDelay { get; set; }
        public double RejectionProbability
        {
            get { return rejectionProbability; }
            set
            {
                rejectionProbability = value;
                if (rejectionProbability > 1)
                    rejectionProbability = 0.99;
                else if (rejectionProbability <= 0)
                    rejectionProbability = 0.01;
            }
        }
        public double MinimumHitRatioProbability
        {
            get { return minimumHitRatioProbability; }
            set
            {
                minimumHitRatioProbability = value;
                if (minimumHitRatioProbability > 1)
                    minimumHitRatioProbability = 0.99;
                else if (minimumHitRatioProbability <= 0)
                    minimumHitRatioProbability = 0.01;
            }
        }
        public double HITorTAKEProbability
        {
            get { return hitorTakeProbability; }
            set
            {
                hitorTakeProbability = value;
                if (hitorTakeProbability > 1)
                    hitorTakeProbability = 0.99;
                else if (hitorTakeProbability <= 0)
                    hitorTakeProbability = 0.01;
            }
        }
    }
}